package com.atguigu.base;

import org.springframework.ui.Model;

public class BaseController {
    private final static String PAGE_SUCCESS = "common/successPage";
    private final static String PAGE_FAILURE = "common/failurePage";
    public String successPage(Model model, String successMessage){
        model.addAttribute("messagePage",successMessage);
        return PAGE_SUCCESS;
    }

    public String failurePage(Model model, String failureMessage) {
        // 将失败消息添加到模型中，以便在页面上展示
        model.addAttribute("messagePage", failureMessage);
        // 返回创建失败页面的视图名称
        return PAGE_FAILURE;
    }
}
